home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Apr 89 / T0017-Locks are Dangerous-Apr89 < prev    next >
Encoding:
Text File  |  1989-04-13  |  1.2 KB  |  31 lines  |  [TEXT/GEOL]

  1. Item    3418450                         13-April-89        02:35
  2.  
  3. From:   UK0016                          Icon Technology UK
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Locks are Dangerous!
  8.  
  9. Locking handles/objects by whatever means is potentially dangerous.
  10.  
  11. For example, what happens if an exception is signalled while one or more
  12. objects are locked? Who is responsible for ensuring that they are unlocked?
  13. Obviously the exception handlers, which must be able to identify the locked
  14. objects and their current lock state: this is dubious and messy.
  15.  
  16. Objects that are locked, particularly for long periods of time, are liable to
  17. cause heap fragmentation problems.
  18.  
  19. Careful coding methods should reduce the need for locks to an absolute minimum.
  20. Our policy is to make the use of locks illegal unless a watertight case can be
  21. made for using them: so far the only cases that we have found necessary in 900
  22. methods are to lock an object that contains text that is being passed by
  23. pointer to QD routines.
  24.  
  25. That said, I feel I must agree with Paul Smith: if there is to be a locking
  26. mechanism in the release version of 2.0, then for goodness sake let it be a
  27. proper semaphore mechanism such as the one he proposes.
  28.  
  29. Regards, Keith Lander
  30.  
  31.